export default {
  functional: true,
  render(h, { data, props }) {
    const { options = [], radioType } = props
    return (
      <el-radio-group {...data}>
        {options.map(options => (
          <Radios radioType={radioType} {...{ attrs: options }}></Radios>
        ))}
      </el-radio-group>
    )
  }
}

export const Radios = {
  functional: true,
  render(h, { data, props }) {
    const { label, value, radioType } = props
    const Tag = radioType === 'btn' ? 'el-radio-button' : 'el-radio'
    return (
      <Tag {...data} label={value}>
        {label}
      </Tag>
    )
  }
}
